var status = -1;

function start() {
    action(1, 0, 0)
}

function action(c, b, a) {
    status++;
    if (cm.isQuestFinished(22734) && cm.getNumberFromQuestInfo(22740, "view1") == 0) {
        action1(c, b, a)
    } else {
        if (cm.isQuestActive(22786) && !cm.isQuestFinished(22786)) {
            action2(c, b, a)
        } else {
            cm.dispose()
        }
    }
}

function action1(d, c, b) {
    var a = -1;
    if (status <= a++) {
        cm.dispose()
    } else {
        if (status === a++) {
            cm.curNodeEventEnd(true);
            cm.eventSKill(0);
            cm.setInGameDirectionMode(true, false, true);
            cm.setStandAloneMode(true);
            cm.inGameDirectionEvent_SetAdditionalEffectVisibleForInGameDirection();
            cm.fieldEffect_InsertCanvas(1, 255, 0, 0, 0, 0, 0);
            cm.inGameDirectionEvent_AskAnswerTime(1000);
            cm.curNodeEventEnd(true)
        } else {
            if (status === a++) {
                cm.inGameDirectionEvent_PushScaleInfo(0, 0, 2000, 0, 34, -923)
            } else {
                if (status === a++) {
                    cm.inGameDirectionEvent_AskAnswerTime(500)
                } else {
                    if (status === a++) {
                        cm.inGameDirectionEvent_PushScaleInfo(3000, 0, 2000, 3000, 14, -933)
                    } else {
                        if (status === a++) {
                            cm.fieldEffect_InsertCanvas(1, 180, 0, 0, 0, 1500, 0);
                            cm.inGameDirectionEvent_AskAnswerTime(1500)
                        } else {
                            if (status === a++) {
                                cm.fieldEffect_InsertCanvas(1, 255, 0, 0, 0, 1500, 0);
                                cm.inGameDirectionEvent_AskAnswerTime(1500)
                            } else {
                                if (status === a++) {
                                    cm.inGameDirectionEvent_Monologue("这是什么……难道是梦吗? ", 1)
                                } else {
                                    if (status === a++) {
                                        cm.inGameDirectionEvent_PushScaleInfo(0, 0, 2000, 0, -126, -350)
                                    } else {
                                        if (status === a++) {
                                            cm.inGameDirectionEvent_AskAnswerTime(500)
                                        } else {
                                            if (status === a++) {
                                                cm.inGameDirectionEvent_PushScaleInfo(3000, 0, 2000, 3000, -100, -373)
                                            } else {
                                                if (status === a++) {
                                                    cm.fieldEffect_InsertCanvas(1, 100, 0, 0, 0, 1500, 0);
                                                    cm.inGameDirectionEvent_AskAnswerTime(1500)
                                                } else {
                                                    if (status === a++) {
                                                        cm.fieldEffect_InsertCanvas(1, 255, 0, 0, 0, 1500, 0);
                                                        cm.inGameDirectionEvent_AskAnswerTime(1500)
                                                    } else {
                                                        if (status === a++) {
                                                            cm.inGameDirectionEvent_Monologue("呃,  我的头……\r\n这里到底是哪里? ", 1)
                                                        } else {
                                                            if (status === a++) {
                                                                cm.inGameDirectionEvent_PushScaleInfo(0, 0, 1000, 0, -137, -1000)
                                                            } else {
                                                                if (status === a++) {
                                                                    cm.inGameDirectionEvent_AskAnswerTime(500)
                                                                } else {
                                                                    if (status === a++) {
                                                                        cm.fieldEffect_InsertCanvas(0, 0, 0, 0, 0, 1000, 0);
                                                                        cm.inGameDirectionEvent_AskAnswerTime(1500)
                                                                    } else {
                                                                        if (status === a++) {
                                                                            cm.inGameDirectionEvent_AskAnswerTime(2500);
                                                                            cm.effect_Text(["#fn黑体##fs26#冒险岛世界,  魔法密林\r\n#fs14#-魔法师协会-"], [100, 2500, 4, 0, 0, 1, 4, 0, 0, 0, 0])
                                                                        } else {
                                                                            if (status === a++) {
                                                                                cm.inGameDirectionEvent_PushScaleInfo(4000, 0, 1000, 4000, -137, -100)
                                                                            } else {
                                                                                if (status === a++) {
                                                                                    cm.inGameDirectionEvent_AskAnswerTime(4000)
                                                                                } else {
                                                                                    if (status === a++) {
                                                                                        cm.OverlapScreenDetail19(0, 1000, 3000, 1);
                                                                                        cm.inGameDirectionEvent_PushScaleInfo(0, 0, 1000, 2147483647, 2147483647, 2147483647)
                                                                                    } else {
                                                                                        if (status === a++) {
                                                                                            cm.inGameDirectionEvent_PushMoveInfo(1, 0, 0, 0)
                                                                                        } else {
                                                                                            if (status === a++) {
                                                                                                cm.inGameDirectionEvent_AskAnswerTime(300)
                                                                                            } else {
                                                                                                if (status === a++) {
                                                                                                    cm.fieldEffect_RemoveOverlapScreenDetail(1000);
                                                                                                    cm.setStandAloneMode(false);
                                                                                                    cm.inGameDirectionEvent_ForcedFlip15(700, 0, 0, 0, 0);
                                                                                                    cm.eventSKill(0);
                                                                                                    cm.setInGameDirectionMode(false, true, false);
                                                                                                    cm.updateInfoQuest(22740, "view1=1");
                                                                                                    cm.dispose()
                                                                                                }
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

function action2(e, d, c) {
    if (cm.getPlayer().getGender() == 0) {
        var a = 1531000
    } else {
        var a = 1531052
    }
    var b = -1;
    if (status <= b++) {
        cm.dispose()
    } else {
        if (status === b++) {
            cm.sendNormalTalk_Bottom("#face9#凯内西斯，你成功地找到了失踪者呢。", 37, 1531001, false, true)
        } else {
            if (status === b++) {
                cm.onActionBarResult(6, -1);
                cm.sendNormalTalk_Bottom("嗯，这点小事儿嘛。", 37, a, true, true)
            } else {
                if (status === b++) {
                    cm.sendNormalTalk_Bottom("#face9#总之你变得越强大，就离世界和平越近了一步。\r\n慢慢修炼到60级左右怎么样？", 37, 1531001, true, true)
                } else {
                    if (status === b++) {
                        cm.forceCompleteQuest(22786);
                        cm.dispose()
                    }
                }
            }
        }
    }
}

function action3(d, c, b) {
    var a = -1;
    if (status <= a++) {
        cm.dispose()
    } else {
        if (status === a++) {}
    }
}

function action4(d, c, b) {
    var a = -1;
    if (status <= a++) {
        cm.dispose()
    } else {
        if (status === a++) {}
    }
};